local HeartBeatService = class("HeartBeatService")

local BEAT_TIME = 5

function HeartBeatService:ctor()
    self._totalDt = 0
end

function HeartBeatService:update(dt)
    self._totalDt = self._totalDt + dt
    if self._totalDt >= BEAT_TIME then
        self._totalDt = 0
        G_UserData:getServerTime():c2sHeartBeat() -- 发送心跳包
    end
end

return HeartBeatService
